//
//  Macro.h
//  MyFunctionDemo
//
//  Created by Ting Han on 2017/9/1.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#ifndef Macro_h
#define Macro_h

//屏幕尺寸
#define kHTScreenWidth [UIScreen mainScreen].bounds.size.width
#define kHTScreenHeight [UIScreen mainScreen].bounds.size.height
#define kHTNavicationBarHeigth 44.0
#define kHTStatusBarHeight 20.0
#define kHTToolBarHeight 49.0
#define kHTNavicationBarAndStatusBar 64.0

//屏幕适配，比例适配,以7为基准
#define kHTWidthScale [UIScreen mainScreen].bounds.size.width/375.0
#define kHTHeightScale [UIScreen mainScreen].bounds.size.height/667.0
#define kHeight(y) kHTHeightScale*y
#define kWidth(x) kHTWidthScale*x

//color
#define HTColorFromRGB(rgbValue)  [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0  blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define HTColorRGB(r,g,b)  [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define HTColorRGBA(r,g,b,a)  [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]


//debug log
#ifdef DEBUG
#define DBLog(...) NSLog(@"%s(第%d行) %@", __PRETTY_FUNCTION__, __LINE__, [NSString stringWithFormat:__VA_ARGS__])
#else
#define DBLog(...)
#endif

/**
 *  iPhone4 or iPhone4s
 */
#define  iPhone4_4s     (Width == 320.f && Height == 480.f ? YES : NO)

/**
 *  iPhone5 or iPhone5s
 */
#define  iPhone5_5s     (Width == 320.f && Height == 568.f ? YES : NO)

/**
 *  iPhone6 or iPhone6s
 */
#define  iPhone6_6s     (Width == 375.f && Height == 667.f ? YES : NO)

/**
 *  iPhone6Plus or iPhone6sPlus
 */
#define  iPhone6_6sPlus (Width == 414.f && Height == 736.f ? YES : NO)

#define _md_get_weakSelf() __weak typeof(self) weakSelf = self

#define noti_showHomePageTableView @"noti_showHomePageTableView"




#endif /* Macro_h */
